package com.sac.approval.domain;

import com.sac.common.utils.DateUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 
 * 
 * @author chglee
 * @email 1992lcg@163.com
 * @date 2018-09-18 14:37:46
 */
@Data
public class ApprovalTemplateDO implements Serializable {
	private static final long serialVersionUID = 1L;
	
	//主键
	private String appTemplateId;
	//标题
	private String title;

	private String content;
	//文本类型：0  plain 1 html 2 mhtml
	private String contType;
	//编码
	private String charSet;
	//保密类型
	private String secretType;

	private String urgentType;

	private String urgentTypeString;

	//0- 1-全部
	private String notifyType;

	//Draft or Template 草稿箱还是模板
	private String dot;

	private String isDelete;
	//创建人
	private String createUser;

	private String createUserNm;
	//创建时间
	private Date createTime;

	private String createTimeString;

	//创建时间
	private Date updateTime;

	private List<ApprovalLineTemplateDO> lineTemplateList;

	private List<AttachmentDO> attachmentList;

	public String getCreateTimeString() {
		return DateUtils.format(this.createTime,"MM-dd hh:mm");
	}

    public String getUrgentTypeString() {
        String r = "General";
        if("Y".equalsIgnoreCase(this.urgentType))
            r = "Urgent";
        else if("N".equalsIgnoreCase(this.urgentType))
            r = "General";
        return r;
    }
}
